package com.example.his.api.mis.controller.form.dept;

import org.hibernate.validator.constraints.Range;

import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class SearchDeptByPageForm {
  
  @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{2,20}$", message = "deptName格式错误")
  private String deptName;
  
  @Pattern(regexp = "^1[0-9]{10}$", message = "tel格式错误")
  private String tel;
  
  @Email
  private String email;
  
  @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{1,20}$", message = "desc格式错误")
  private String desc;
  
  @NotNull(message = "page不能为空")
  @Min(value = 1, message = "page不能小于1")
  private Integer page;
  
  @NotNull(message = "length不能为空")
  @Range(min = 10, max = 100, message = "length必须在10-100之间")
  private Integer length;
}
